package com.hw.paltfrom.controller.system;

import com.hw.paltfrom.pack.ResponseResult;
import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.system.BaseOverrunstationServer;
import com.hw.paltfrom.utils.VerifyUtil;
import com.hw.paltfrom.vo.BaseOverrunstationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
* 超限检测站管理
* 梁天
* 2019/11/06
*
**/
@RestController
@RequestMapping(value = "/BaseOverrunStationController")
public class BaseOverrunStationController {

    @Autowired
    BaseOverrunstationServer baseOverrunstationServer;

    /**
     * 分页+模糊查询
     *
     * @param vo
     * @return
     */
    @RequestMapping(value = "/queryAllList")
    public Map<String, Object> queryAllList(@RequestParam HashMap<String,Object> vo) {
       
        return baseOverrunstationServer.queryAllList(vo);
    }


    /**
     * 添加
     *
     * @param vo
     * @return
     */
    @RequestMapping(value = "/add")
    public Map<String, Object> userAdd(BaseOverrunstationVO vo) {
        Boolean flag = VerifyUtil.verifyParams(vo);
        if (!flag) {
            return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
        }
        return baseOverrunstationServer.insert(vo);
    }


    /**
     * 行政区域更新 或 删除
     * 删除fDeletemark传1  更新传0
     *
     * @param vo
     * @return
     */
    @RequestMapping(value = "/update")
    public Map<String, Object> update(BaseOverrunstationVO vo) {
        Boolean flag = VerifyUtil.verifyParams(vo);
        if (!flag) {
            return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
        }
        return baseOverrunstationServer.update(vo);

    }



    /**
     * 代办领导更新
     *
     * @param vo
     * @return
     */
    @RequestMapping(value = "/updateDb")
    public Map<String, Object> updateDb(BaseOverrunstationVO vo) {
        Boolean flag = VerifyUtil.verifyParams(vo);
        if (!flag) {
            return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
        }
        return baseOverrunstationServer.updateDb(vo);

    }



}
